package com.wfx.controller;


import com.wfx.entity.Result;
import com.wfx.entity.WxbCustomer;
import com.wfx.entity.WxbMemeber;
import com.wfx.service.IWxbMemeberService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zhu
 * @since 2021-01-26
 */
@RestController
@RequestMapping("/memeber")
@CrossOrigin
public class WxbMemeberController {
    @Autowired
    private IWxbMemeberService wxbMemeberService;

    @PostMapping("/regist")
    @ApiOperation("注册")
    public Result regist(@RequestBody WxbMemeber wxbMemeber){
        Result result = wxbMemeberService.insertMemeber(wxbMemeber);
        return result;
    }

    @GetMapping("/check")
    @ApiOperation("注册用户名校验")
    public Result check(String account){
        return wxbMemeberService.checkName(account);
    }

    @RequestMapping("/sendCode")
    public Result sendCode(String phone){
        return wxbMemeberService.sendCode(phone);
    }

}
